﻿//-----------------------------------------------------------------------
// <copyright file="CommandsBuilderTests.cs" author="Artak Mkrtchyan">
//     Creative Commons - GNU General Public License (http://creativecommons.org/licenses/GPL/2.0/
// </copyright>
// <author>Artak Mkrtchyan</author>
// <email>mkArtak@gmail.com</email>
// <date>03/05/2013</date>
//-----------------------------------------------------------------------

using ConsoleHoster.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace ConsoleHoster.UnitTests.ModelTests
{
	[TestClass]
	public class CommandsBuilderTests
	{
		[TestMethod]
		public void Constant_ChangeDirectoryCommand_HasExpectedValue()
		{
			Assert.AreEqual("cd /d ", CommandsBuilder.ChangeDirectoryCommand);
		}

		[TestMethod]
		public void GetRedirectCommand()
		{
			const string tmpTarget = "some other folder";

			Assert.AreEqual(CommandsBuilder.ChangeDirectoryCommand + "\"" + tmpTarget + "\"", CommandsBuilder.GetRedirectCommand(tmpTarget));
		}

		[TestMethod]
		[ExpectedException(typeof(ArgumentNullException))]
		public void GetRedirectCommand_ThrowsOnNullArgument()
		{
			CommandsBuilder.GetRedirectCommand(null);
		}
	}
}
